#include "gtkbindings.h"
#include "gtkbox.h"
#include "gtkcontainerprivate.h"
-#include "gtkcsscustomgadgetprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtkimage.h"
#include "gtkintl.h"
GtkWidget *arrow;
GtkWidget *arrow_button;
- GtkCssGadget *gadget;
GtkAllocation prev_allocation;
GList *content;
GParamSpec *pspec);
static void gtk_toolbar_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot);
-static void gtk_toolbar_measure_ (GtkWidget *widget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline);
static void gtk_toolbar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_toolbar_style_updated (GtkWidget *widget);
static gboolean gtk_toolbar_popup_menu (GtkWidget *toolbar);
static void gtk_toolbar_reconfigured (GtkToolbar *toolbar);
-static void gtk_toolbar_allocate (GtkCssGadget *gadget,
- const GtkAllocation *allocation,
- int baseline,
- GtkAllocation *out_clip,
- gpointer data);
-static void gtk_toolbar_measure (GtkCssGadget *gadget,
+static void gtk_toolbar_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
- int *natural_baseline,
- gpointer data);
+ int *natural_baseline);
static void gtk_toolbar_pressed_cb (GtkGestureMultiPress *gesture,
int n_press,
double x,
gobject_class->dispose = gtk_toolbar_dispose;
widget_class->snapshot = gtk_toolbar_snapshot;
- widget_class->measure = gtk_toolbar_measure_;
+ widget_class->measure = gtk_toolbar_measure;
widget_class->size_allocate = gtk_toolbar_size_allocate;
widget_class->style_updated = gtk_toolbar_style_updated;
widget_class->focus = gtk_toolbar_focus;
{
GtkToolbarPrivate *priv;
GtkWidget *widget;
- GtkCssNode *widget_node;
widget = GTK_WIDGET (toolbar);
toolbar->priv = gtk_toolbar_get_instance_private (toolbar);
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (toolbar));
- widget_node = gtk_widget_get_css_node (widget);
- priv->gadget = gtk_css_custom_gadget_new_for_node (widget_node,
- widget,
- gtk_toolbar_measure,
- gtk_toolbar_allocate,
- NULL,
- NULL, NULL);
-
priv->arrow_button = gtk_toggle_button_new ();
g_signal_connect (priv->arrow_button, "button-press-event",
G_CALLBACK (gtk_toolbar_arrow_button_press), toolbar);
}
static void
-gtk_toolbar_measure (GtkCssGadget *gadget,
+gtk_toolbar_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
- int *natural_baseline,
- gpointer data)
+ int *natural_baseline)
{
- GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
GtkToolbarPrivate *priv = toolbar->priv;
GList *list;
}
}
-static void
-gtk_toolbar_measure_ (GtkWidget *widget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline)
-{
- GtkToolbar *toolbar = GTK_TOOLBAR (widget);
- GtkToolbarPrivate *priv = toolbar->priv;
-
- gtk_css_gadget_get_preferred_size (priv->gadget,
- orientation,
- for_size,
- minimum, natural,
- minimum_baseline, natural_baseline);
-
-}
-
static gint
position (GtkToolbar *toolbar,
gint from,
g_source_set_name_by_id (priv->idle_id, "[gtk+] slide_idle_handler");
}
- gtk_css_gadget_get_content_allocation (priv->gadget,
- &content_allocation, NULL);
+ gtk_widget_get_content_allocation (widget, &content_allocation);
rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
vertical = (priv->orientation == GTK_ORIENTATION_VERTICAL);
}
static void
-gtk_toolbar_allocate (GtkCssGadget *gadget,
- const GtkAllocation *allocation,
- int baseline,
- GtkAllocation *out_clip,
- gpointer data)
+gtk_toolbar_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation)
{
- GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
GtkToolbarPrivate *priv = toolbar->priv;
GtkAllocation arrow_allocation, item_area, widget_allocation;
g_free (allocations);
g_free (new_states);
-}
-
-static void
-gtk_toolbar_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
-{
- GtkToolbar *toolbar = GTK_TOOLBAR (widget);
- GtkToolbarPrivate *priv = toolbar->priv;
- GtkAllocation clip;
-
- gtk_widget_set_allocation (widget, allocation);
-
- gtk_css_gadget_allocate (priv->gadget,
- allocation,
- gtk_widget_get_allocated_baseline (widget),
- &clip);
- gtk_widget_set_clip (widget, &clip);
+ gtk_widget_set_clip (widget, allocation);
}
static void
if (priv->idle_id)
g_source_remove (priv->idle_id);
- g_clear_object (&priv->gadget);
g_clear_object (&priv->click_gesture);
G_OBJECT_CLASS (gtk_toolbar_parent_class)->finalize (object);